﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace VoxelBlock
{
    public static class VoxelCategories
    {
        public const string USERDATA_PATH = "UserData";
        public const string PALATTE_PATH = "Palatte";
        public const string SAVE_PATH = "Save";


        public const int MAX_SURFACE_SIZE = 16250;
        public const int MAX_POSITION_X = 512;
        public const int MAX_POSITION_Y = 512;
        public const int MAX_POSITION_Z = 512;
        public const int MIN_POSITION_X = -512;
        public const int MIN_POSITION_Y = 0;
        public const int MIN_POSITION_Z = -512;


        public const int MAX_SIZE_X = 1024;
        public const int MAX_SIZE_Y = 512;
        public const int MAX_SIZE_Z = 1024;

        /// <summary>
        /// 笔刷操作
        /// </summary>
        public enum OperationBrush
        {
            Brush = 0,
            Rectangle = 1,//矩形
            Slice = 2,//一片
            Line = 3,//直线
            Scale = 4,//缩放
        };

        /// <summary>
        /// 行为操作
        /// </summary>
        public enum OperationBehavior
        {
            Add = 0,
            Remove = 1,
            Paint = 2,
            Read = 3,
            Select = 4,
            Transform = 5,
        };

        /// <summary>
        /// 选择操作
        /// </summary>
        public enum OperationSelectOperator
        {
            /// <summary>
            /// 并
            /// </summary>
            Union,
            ///// <summary>
            ///// 交
            ///// </summary>
            //Intersection,
            ///// <summary>
            ///// 补
            ///// </summary>
            //Complement,
            /// <summary>
            /// 清除
            /// </summary>
            Remove
        };

        public enum Operation
        {
            /// <summary>
            /// 没有
            /// </summary>
            Not = 0,
            /// <summary>
            /// 添加
            /// </summary>
            Add = 1,
            /// <summary>
            /// 移除
            /// </summary>
            Remove = 2,
            /// <summary>
            /// 修改，置换
            /// </summary>
            Paint = 3,
            /// <summary>
            /// 添加或者修改
            /// </summary>
            AddOrPaint = 4,
            /// <summary>
            /// 选择
            /// </summary>
            SelectAdd = 5,
            /// 移除选择
            /// </summary>
            SelectRemove = 6,
        };

        /// <summary>
        /// 一个Chunk的GameObject 的 layer
        /// </summary>
        public const int CHUNK_GAMEOBJECT_LAYER = 9;

        /// <summary>
        /// 一个面的顶点数
        /// </summary>
        public const int UNIT_VERTICES_LENGTH = 4;

        /// <summary>
        /// 一个block的面数
        /// </summary>
        public const int SURFACE_LENGTH = 6;
        
        /// <summary>
        /// 一个Chunk的分量长度
        /// </summary>
        public const int CHUNK_UNIT_LENGTH = 16;

        /// <summary>
        /// 一个Chunk的分量长度 减一
        /// </summary>
        public const int CHUNK_UNIT_LENGTH_Minus1 = 15;

        /// <summary>
        /// 一个Chunk的分量长度的位数，即是16是2的4次方
        /// </summary>
        public const int CHUNK_UNIT_LENGTH_BIT = 4;

        /// <summary>
        /// 一个Chunk的最大容量
        /// </summary>
        public const int CHUNK_LENGTH = 4096;

        /// <summary>
        /// 一个Chunk的最大容量*6，即是最大面数容量
        /// </summary>
        public const int CHUNK_SURFACE_LENGTH = 16384;


        public const int MAX_UV_X = 8;
        public const int MAX_UV_Y = 32;

        public const int DIRECTION_RIGHT = 0;
        public const int DIRECTION_LEFT = 1;
        public const int DIRECTION_UP = 2;
        public const int DIRECTION_DOWN = 3;
        public const int DIRECTION_FRONT = 4;
        public const int DIRECTION_BREAK = 5;

        public const int DIRECTION_UP_2D = 0;
        public const int DIRECTION_DOWN_2D = 1;
        public const int DIRECTION_LEFT_2D = 2;
        public const int DIRECTION_RIGHT_2D = 3;
    }
}
